<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="Access-Control-Allow-Origin" content="*"> 
		<title>400电话修改</title>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css"/>
		<link rel="stylesheet" href="js/themes/default/easyui.css"/>
		<!--<link rel="stylesheet" href="css/lib/loading.css" />-->
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>
		<script src="js/lib/vue.min.js"></script>
		<script src="js/lib/vue-resource.js"></script>
		<!--<script src="js/lib/loading.js"></script>-->
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
		<style>
		body{
			font-size:12px;
		}
		table td:nth-child(odd) {
			background-color: #f1f1f1;
			width:160px;
		}
		table td:nth-child(even) {
			width:160px;
		}
		table tr:nth-child(even) {
			background-color:#ffffff;
		}
		input{
			width:280px;
		}
		span{
			width:20px;color:red;display:inline-block;text-align:center;
		}
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
		</style>
	</head>
	<body style="font-size:12px;">
		<div class="" id="box">
		<!--提示框-->	
			<div id="sho"></div>
		<!--加载动画-->
		<div class="wrapper">
            <div id="loader-wrapper">
                <div id="loader"></div>
            </div>
        </div>
		<!--查询权限-->
		<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
			<table class="table table-hover">				
				<tbody>
					<tr>
						<th colspan="8">客服电话修改:</th>
					</tr>
					<tr>
						<td style="text-align:right">
							贴牌id；
						</td>
						<td colspan="7">							
							 <div id="name" class="form-control" style="width:280px"><div> 

						</td>								
					</tr>
					<tr>
						<td style="text-align:right">
							客服电话：
						</td>
						<td colspan="7">
							  <input id="phone" class="form-control" type="text" placeholder="请输入客服电话号码" style="width:280px"/>
						</td>
					</tr>
					<tr>
						<td style="text-align:right">
							客服QQ：
						</td>
						<td colspan="7">
							  <input id="qq" class="form-control" type="text" placeholder="请输入客服QQ号码" style="width:280px"/>
						</td>
					</tr>
					<tr>
						<td style="text-align:right">
							客服微信：
						</td>
						<td colspan="7">
							  <input id="weixin" class="form-control" type="text" placeholder="请输入客服微信号码" style="width:280px"/>
						</td>
					</tr>
					<tr>
						<td colspan="8">
							
							<button v-on:click="add()" class="btn btn-danger" style="display:block;margin:0 auto">修改</button>
							
						</td>					
					</tr>
					
				</tbody>
			</table>		
		</div>	
		</div>		
	</body>
	<script>
		$(function(){
				 /*获取所有贴牌商名称和val*/
				 var name =sessionStorage.getItem(key=100);
				 var bd =  sessionStorage.getItem(key=3);				 
		       	$('#name').html(sessionStorage.getItem(key=100));
		       	
		       	console.log(bd)
	new Vue({
				el:"#box",
				data:{
					list:[],					
				},
				methods:{					
					/*点击修改客服电话*/
					add:function(){
						var p1 = sessionStorage.getItem(key=3);
						var p2 = $("#phone").val();
						var p3 = $('#qq').val();
						var p4 = $('#weixin').val();
						var datas = {
							 brand_id:p1,
							 brand_phone:p2,
							 brand_qq:p3,
							 brand_weixin:p4
						}; 
						console.log(datas);
						if(confirm('确认修改吗?')){
							this.$http.post(window.baseUrl+"user/brand/phone/update/id",datas,{emulateJSON:true}).then(
								   function (res) { 
								    console.log(res)
								   this.list = res.data.content
								   console.log(this.list)
								    $('#sho').stop().show().text("")
								    $('#sho').stop().fadeOut(2500).text("修改信息成功")
								   },function (res){ 
								   	alert("查询数据失败！")								   
								   } 
								  );
						}else{
							return alert("已取消")
						}					
						
					}
					
				}
			})
		})
	</script>
</html>
